package cool.tianyou.blue.bird.common.model.po;

import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * @author Liutianyou
 * @date 2021/7/18 1:14 下午
 */
@Table(name = "t_device")
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class Device {

  @Id
  @GeneratedValue(generator = "JDBC")
  private Integer id;
  private String publicKey;
  private String deviceName;
  private Boolean disabled;
  private Date lastLoginTime;
  private Integer userId;
  private String alias;
  private Boolean online;
  private String type;
  private Boolean major;
  private Boolean pushState;

  public Device(LoginUser loginUser) {
    this.id = loginUser.getDeviceId();
    this.alias = loginUser.getAlias();
  }
}
